package com.forclass;

public class LayzzySingleTon {
    private static volatile LayzzySingleTon instance;
    private LayzzySingleTon() {
        System.out.println("私有构造法方法");
    }
    public static  LayzzySingleTon getInstance() {
        if (instance == null) {
            synchronized (LayzzySingleTon.class) {
                if (instance == null) {
                    instance = new LayzzySingleTon();
                }
            }
        }
        return instance;
    }
}
